import http from "~/api/index.js";

// 注册
export const register = ({ nickname, password }) => {
  return http({
    url: "/register",
    method: "post",
    data: { nickname, password },
  });
};

// 登录
export const login = params => {
  return http({
    url: "/login",
    method: "get",
    params,
  });
};

// 修改密码
export const changePwd = ({ username, oldPassword, newPassword }) => {
  return http({
    url: "/change_password",
    method: "put",
    data: { username, oldPassword, newPassword },
  });
};
